//
//  CustomTableViewCell.m
//  SYiDaiy
//
//  Created by dllo on 16/8/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustomTableViewCell.h"
#import "UIView+Label.h"
#import "TAMacro.h"
#import "UIView+ImageView.h"
@implementation CustomTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _cover_thumb_hdImageView = [[UIImageView alloc] creatImageViewWithFrame:CGRectZero backgroudColor:[UIColor whiteColor]];
        _titleLabel = [[UILabel alloc] creatLabelWithFrame:CGRectZero tintColor:[UIColor whiteColor] font:[UIFont systemFontOfSize:16]];
        _pubdateLabel = [[UILabel alloc] creatLabelWithFrame:CGRectZero tintColor:[UIColor greenColor] font:[UIFont systemFontOfSize:13]];
        _pubdateLabel.textColor = [UIColor blackColor];
        _pubdateLabel.alpha = 0.4;
        _summaryLabel = [[UILabel alloc] creatLabelWithFrame:CGRectZero tintColor:[UIColor redColor] font:[UIFont systemFontOfSize:14]];
        _summaryLabel.textColor = [UIColor blackColor];
        _summaryLabel.alpha = 0.6;
        _summaryLabel.numberOfLines = 0;
        [self.contentView addSubview:_titleLabel];
        [self.contentView addSubview:_pubdateLabel];
        [self.contentView addSubview:_summaryLabel];
        [self.contentView addSubview:_cover_thumb_hdImageView];
    }
    return self;
}


- (void)layoutSubviews
{
    CGFloat imageWidth = SCREEN_WIDTH * 120 / 375;
    CGFloat labelWidth = SCREEN_WIDTH - imageWidth - 25;
    _cover_thumb_hdImageView.frame = CGRectMake(10, 10, imageWidth, imageWidth);
    _titleLabel.frame = CGRectMake(imageWidth + 15, 10, labelWidth, imageWidth / 6);
    _pubdateLabel.frame = CGRectMake(imageWidth + 15, 10 + imageWidth / 6, labelWidth, imageWidth / 6);
    _summaryLabel.frame = CGRectMake(imageWidth + 15, imageWidth / 6 * 2 + 10, labelWidth, imageWidth / 3 * 2);
}


- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    
}

@end
